<?php
/* @var $this UserRoleController */
/* @var $model UserRole */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-role-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>
<table width="400px">
	<tr>
		<td colspan="2"><p class="note">Fields with <span class="required">*</span> are required.</p></td>		
	</tr>
	<tr>
		<td colspan="2"><?php echo $form->errorSummary($model); ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($model,'user_id'); ?>
		</td>
		<td><?php  echo $form->dropDownList($model,'user_id', 
			CHtml::listData(UserRole::model()->getUserNamesNotExists(), 'id', 'username'), 
			array('empty'=>'Select Username')); 
                //UserRole::model()->getUserNamesNotExists();
                        ?>
		<?php echo $form->error($model,'user_id'); ?></td>
	</tr>
	<tr>
		<td>		<?php echo $form->labelEx($model,'user_type_id'); ?>
		</td>
		<td><?php echo $form->dropDownList($model,'user_type_id', 
			CHtml::listData(UserType::model()->findAll(), 'id', 'type'), 
			array('empty'=>'Select Type')); 
                ?>
		<?php echo $form->error($model,'user_type_id'); ?></td>
	</tr>
	<tr>
		<td colspan="2"><?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?></td>
	</tr>
</table>

<?php $this->endWidget(); ?>

</div><!-- form -->